package com.duobaoyu.dby.supply.job.task.channel;

import com.duobaoyu.dby.channel.adapter.enums.ChannelCodeEnum;
import com.duobaoyu.dby.channel.adapter.enums.biz.message.MessageTypeEnum;
import com.duobaoyu.dby.supply.biz.client.boundary.message.ChannelPullMessageBoundaryClient;
import com.duobaoyu.dby.supply.core.dinger.annotation.DingerTalk;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 渠道商品任务
 *
 * @author yanhan
 * @version 1.0.0
 * @date 2023/9/26 17:32
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class ChannelProductTask {

    private final ChannelPullMessageBoundaryClient channelPullMessageBoundaryClient;

    /**
     * 京东商品拉取价格变更消息
     */
    @XxlJob("jdVopProductPriceChangePullMessage")
    @DingerTalk(title = "京东商品拉取价格变更消息异常")
    public void jdVopProductPriceChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP,MessageTypeEnum.POOL_PRODUCT_SALE_PRICE,null);
    }

    /**
     * 京东商品拉取状态变更消息
     */
    @XxlJob("jdVopProductStatusChangePullMessage")
    @DingerTalk(title = "京东商品拉取状态变更消息异常")
    public void jdVopProductStatusChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP,MessageTypeEnum.POOL_PRODUCT_PUBLISH_STATUS,null);
    }

    /**
     * 京东商品拉取状态变更消息
     */
    @XxlJob("jdVopProductDetailChangePullMessage")
    @DingerTalk(title = "京东商品拉取信息变更消息异常")
    public void jdVopProductDetailChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP,MessageTypeEnum.POOL_PRODUCT_DETAIL,null);
    }

    /**
     * 京东商品池拉取新增或者移除商品消息
     */
    @XxlJob("jdVopProductAddOrDeleteProductPullMessage")
    @DingerTalk(title = "京东商品池新增或者移除商品消息异常")
    public void jdVopProductAddOrDeleteProductPullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP,MessageTypeEnum.POOL_PRODUCT_ADD_DELETE,null);
    }

    /**
     * 京东商品池拉取新增或者移除消息
     */
    @XxlJob("jdVopProductAddOrDeletePoolPullMessage")
    @DingerTalk(title = "京东商品池新增或者移除消息异常")
    public void jdVopProductAddOrDeletePoolPullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP,MessageTypeEnum.PRODUCT_POOL_ADD_DELETE,null);
    }


    /**
     * 壹钱包商品拉取价格变更消息
     */
    @XxlJob("oneWalletProductPriceChangePullMessage")
    @DingerTalk(title = "壹钱包商品拉取价格变更消息异常")
    public void oneWalletProductPriceChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ONE_WALLET,MessageTypeEnum.POOL_PRODUCT_SALE_PRICE,null);
    }

    /**
     * 壹钱包商品拉取零售价变更消息
     */
    @XxlJob("oneWalletProductRetailPriceChangePullMessage")
    @DingerTalk(title = "壹钱包商品拉取零售价变更消息异常")
    public void oneWalletProductRetailPriceChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ONE_WALLET,MessageTypeEnum.RETAIL_PRICE_CHANGE,null);
    }

    /**
     * 壹钱包商品拉取状态变更消息
     */
    @XxlJob("oneWalletProductStatusChangePullMessage")
    @DingerTalk(title = "壹钱包商品状态变更消息异常")
    public void oneWalletProductStatusChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ONE_WALLET,MessageTypeEnum.POOL_PRODUCT_PUBLISH_STATUS,null);
    }

    /**
     * 壹钱包商品拉取新增或者删除消息
     */
    @XxlJob("oneWalletProductAddOrDeleteProductPullMessage")
    @DingerTalk(title = "壹钱包商品拉取新增或者删除消息异常")
    public void oneWalletProductAddOrDeleteProductPullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ONE_WALLET,MessageTypeEnum.POOL_PRODUCT_ADD_DELETE,null);
    }

    /**
     * 震坤行商品拉取价格变更消息
     */
    @XxlJob("zkhProductPriceChangePullMessage")
    @DingerTalk(title = "震坤行商品拉取价格变更消息异常")
    public void zkhProductPriceChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ZKH,MessageTypeEnum.POOL_PRODUCT_SALE_PRICE,null);
    }

    /**
     * 震坤行商品拉取状态变更消息
     */
    @XxlJob("zkhProductStatusChangePullMessage")
    @DingerTalk(title = "震坤行商品拉取状态变更消息异常")
    public void zkhProductStatusChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ZKH,MessageTypeEnum.POOL_PRODUCT_PUBLISH_STATUS,null);
    }

    /**
     * 震坤行商品拉取信息变更消息
     */
    @XxlJob("zkhProductDetailChangePullMessage")
    @DingerTalk(title = "震坤行商品拉取信息变更消息异常")
    public void zkhProductDetailChangePullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ZKH,MessageTypeEnum.POOL_PRODUCT_DETAIL,null);
    }

    /**
     * 震坤行商品拉取新增删除消息
     */
    @XxlJob("zkhProductAddOrDeleteProductPullMessage")
    @DingerTalk(title = "震坤行商品拉取新增删除消息异常")
    public void zkhProductAddOrDeleteProductPullMessage() {
        channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ZKH,MessageTypeEnum.POOL_PRODUCT_ADD_DELETE,null);
    }
}
